<?php

namespace App\Http\Controllers;

use App\Models\Category;
use App\Models\Link;
use App\Models\User;
use Illuminate\Http\Request;

class CategoryController extends Controller {
    public function show(Request $request,Category $category,User $user,Link $link) {
        $topics = $category->topics()->with('user','category')->withOrder($request->order)->paginate(10);
        $active_users = $user->getActiveUsers();
        $links = $link->getAllCached();
        return view('topics.index',compact('topics','category','active_users','links'));
    }
}
